package com.zhouzhou.fastjava.criteria;

import com.zhouzhou.fastjava.provider.LanguageProvider;
import org.springframework.context.i18n.LocaleContextHolder;

import java.util.Locale;

public class SpringMVCLanguageProvider implements LanguageProvider {

    @Override
    public String getLang() {
        return getLocale().getLanguage();
    }

    @Override
    public String getLanguage() {
        return getLocale().toString();
    }

    @Override
    public Locale getLocale() {
        return LocaleContextHolder.getLocale();
    }

}
